<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<title>牛只列表</title>
		<link href="css/new_file.css" rel="stylesheet" type="text/css">
		<link href="css/mui.min.css" rel="stylesheet" type="text/css">

		<script charset="UTF-8" src="js/config.js"></script>
		<script charset="UTF-8" src="js/testActivityName.js"></script>
		<script charset="UTF-8" src="js/core.js"></script>
		<script charset="UTF-8" src="js/cipher-core.js"></script>
		<script charset="UTF-8" src="js/tripledes.js"></script>
		<script charset="UTF-8" src="js/mode-ecb.js"></script>
		<script src="js/jquery-1.8.3.min.js"></script>
		<script type="text/javascript" src="js/zepto.min.js"></script>
		<script type="text/javascript" src="js/spin.min.js"></script>
		<script charset="UTF-8" src="js/mui.min.js"></script>
		<script src="js/echarts.min.js"></script>
	</head>

	<body>
	<div class="spin"></div>
		<div class="head-zhjf">
			<img src="images/fanhui@3x.png" class="ryjk-tx" onclick="fanhuisss()">

			<div class="head-zhjf-img" onclick="modifyView()">
				<img src="images/xiugai.png">
			</div>

			<p>详情</p>
		</div>

		<div class="liebiao-div">

			<img class="liebiao-que-l" src="images/banyuan@3x.png" />
			<img class="liebiao-que-r" src="images/banyuan-right@3x.png" />

			<div class="xulieh-div">
				<p class="xulie-p" id="xulie-p">Xl00-18007002-6D79-103826</p>
				<p class="biaoqian-b" id="biaoqian-b">正常</p>
			</div>
			<div>

				<div class="liebiao-aa">
					<p class="liebiao-l">奶牛编号</p>
					<p class="liebiao-r" id="liebiao-r">N20180702</p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">出生日期</p>
					<p class="liebiao-r" id="liebiao-1r">14个月</p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">日龄</p>
					<p class="liebiao-r" id="liebiao-2r">274</p>
					<div class="clear"></div>
				</div>

				<div class="liebiao-aa">
					<p class="liebiao-l">月龄</p>
					<p class="liebiao-r" id="liebiao-3r">9个月</p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">胎次</p>
					<p class="liebiao-r" id="liebiao-17r">9个月</p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">产犊日期</p>
					<p class="liebiao-r" id="liebiao-13r">9个月</p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">泌乳天数</p>
					<p class="liebiao-r" id="liebiao-14r">9个月</p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">上次配种日期</p>
					<p class="liebiao-r" id="liebiao-15r">9个月</p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">繁殖状态</p>
					<p class="liebiao-r" id="liebiao-16r">无记录</p>
					<div class="clear"></div>
				</div>
				<!-- <div class="liebiao-aa">
					<p class="liebiao-l">奶量</p>
					<p class="liebiao-r" id="liebiao-18r">0kg</p>
					<div class="clear"></div>
				</div> -->
				<div class="liebiao-aa">
					<p class="liebiao-l">奶量班次1</p>
					<p class="liebiao-r" id="liebiao-19r">0</p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">奶量班次2</p>
					<p class="liebiao-r" id="liebiao-20r">0</p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">奶量班次3</p>
					<p class="liebiao-r" id="liebiao-21r">0</p>
					<div class="clear"></div>
				</div>

				<div class="liebiao-aa">
					<p class="liebiao-l">牛舍</p>
					<p class="liebiao-r" id="liebiao-4r">03</p>
					<div class="clear"></div>
				</div>

				<div class="liebiao-aa">
					<p class="liebiao-l">设备编号</p>
					<p class="liebiao-r" id="liebiao-5r">L00215845697445</p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">类型</p>
					<p class="liebiao-r" id="liebiao-6r">犊牛</p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">状态</p>
					<p class="liebiao-r" id="liebiao-7r">正常</p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">生理状态</p>
					<p class="liebiao-r" id="liebiao-12r" style="color: blue;text-decoration: underline;" onclick="physiologyBut()">正常</p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">耳号1</p>
					<p class="liebiao-r" id="liebiao-8r"></p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">耳号2</p>
					<p class="liebiao-r" id="liebiao-9r"></p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">怀孕史</p>
					<p class="liebiao-r" id="liebiao-10r"></p>
					<div class="clear"></div>
				</div>
				<div class="liebiao-aa">
					<p class="liebiao-l">品种</p>
					<p class="liebiao-r" id="liebiao-11r"></p>
					<div class="clear"></div>
				</div>
			</div>
			<div class="clear"></div>
		</div>
		<script>
			var equipmentDetails = JSON.parse(localStorage.getItem('equipmentDetails'));
			console.log(equipmentDetails);
			document.getElementById("xulie-p").innerText = equipmentDetails.deviceNumber;
			document.getElementById("biaoqian-b").innerText = equipmentDetails.STATUS;
			document.getElementById("liebiao-r").innerText = equipmentDetails.cowCode;
			document.getElementById("liebiao-1r").innerText = equipmentDetails.birthday;
			document.getElementById("liebiao-2r").innerText = equipmentDetails.ageday;
			document.getElementById("liebiao-3r").innerText = equipmentDetails.monthold;
			document.getElementById("liebiao-4r").innerText = equipmentDetails.houseName;
			document.getElementById("liebiao-5r").innerText = equipmentDetails.deviceCode;
			if (equipmentDetails.cowType!=undefined){
				document.getElementById("liebiao-6r").innerText = equipmentDetails.cowType;
			}
			document.getElementById("liebiao-7r").innerText = equipmentDetails.STATUS;
			document.getElementById("liebiao-8r").innerText = equipmentDetails.overbit1;
			document.getElementById("liebiao-9r").innerText = equipmentDetails.overbit2;
			document.getElementById("liebiao-10r").innerText = equipmentDetails.conceive;
			document.getElementById("liebiao-11r").innerText = equipmentDetails.variety;
			document.getElementById("liebiao-12r").innerText = equipmentDetails.physiology;
			document.getElementById("liebiao-13r").innerText = equipmentDetails.DeliveryDate;
			document.getElementById("liebiao-14r").innerText = equipmentDetails.LactationDate+"天";
			document.getElementById("liebiao-15r").innerText = equipmentDetails.Last_mating;
			document.getElementById("liebiao-16r").innerText = equipmentDetails.reproductive_status;
			document.getElementById("liebiao-17r").innerText = equipmentDetails.parity+"次";
			// document.getElementById("liebiao-18r").innerText = equipmentDetails.milk+"kg";
			document.getElementById("liebiao-19r").innerText = equipmentDetails.milk1+"kg";
			document.getElementById("liebiao-20r").innerText = equipmentDetails.milk2+"kg";
			document.getElementById("liebiao-21r").innerText = equipmentDetails.milk3+"kg";
			function fanhuisss() {
				showDialog();
				Cattle1();
			}

			function physiologyBut() {
				var keys = JSON.parse(localStorage.getItem('key'));
				var map = {};
				map.key = keys;
				map.cowID = equipmentDetails.cowID;
				map.phoneType = "android";
				map.language = "zh";
				var jsonStr = JSON.stringify(map);
				console.log(jsonStr);
				$.ajax({
					type: "POST",
					url: url_prefix + "cowPhysiologyHistory",
					dataType: 'JSON',
					timeout: 10000,
					data: {
						'request': encryptByDES(jsonStr)
					},
					success: function(data) {
						dismissDialog();
						var str1 = decryptByDESModeEBC(data["result"]); //解密
						var params = str1.replace(/\+/g, " "); //去掉字符串里的+号
						var str2 = UTFTranslate.ReChange(chineseFromUtf8Url(params)); //转utf8
						var datas = JSON.stringify(str2); //转JSON字符串
						var aa = datas.replace(/\\n/g, " "); //去掉换行
						var objs = eval('(' + aa + ')');
						var bb = eval('(' + objs + ')');
						if(bb.head.status == 1) {
							console.log(bb.data.length);
							if (bb.data.length == 0) {
								mui.alert("暂无生理状态变化记录")
							}else{
								localStorage.setItem('cowPhysiologyHistoryData', JSON.stringify(bb.data));
								window.location = "牛只生理状态时间轴.html";
							}
							
						} else {
							mui.alert(bb.head.info);
						}
					}
				});
			}
		</script>

	</body>

</html>